import request from '/@/utils/request';

export function leaveApi() {
    return {
        page(data: Object) {
            return request({
                url: '/biz/flow/leave/page',
                method: 'get',
                params: data,
            });
        },
        tree() {
            return request({
                url: '/biz/flow/leave/tree',
                method: 'get',
            });
        },
        save(data: object) {
            return request({
                url: '/biz/flow/leave/save',
                method: 'post',
                data,
            });
        },
        update(data: object) {
            return request({
                url: '/biz/flow/leave/update',
                method: 'post',
                data,
            });
        },
        del(id: string) {
            return request({
                url: '/biz/flow/leave/delete',
                method: 'post',
                data: { id: id },
            });
        },
        export(data: Object) {
            return request({
                url: '/biz/flow/leave/export',
                method: 'post',
                params: data,
            });
        },
        get(id: string) {
            return request({
                url: '/biz/flow/leave/' + id,
                method: 'get',
            });
        },
        submit(data: object) {
            return request({
                url: '/biz/flow/leave/submit',
                method: 'get',
                params: data,
            });
        },
        handle(data: object) {
            return request({
                url: '/biz/flow/leave/handle',
                method: 'post',
                data,
            });
        },
        rejectLast(data: object) {
            return request({
                url: '/biz/flow/leave/rejectLast',
                method: 'post',
                data,
            });
        },
        taskBack(data: object) {
            return request({
                url: '/biz/flow/leave/taskBack',
                method: 'post',
                data,
            });
        },
        revoke(id: string) {
            return request({
                url: '/biz/flow/leave/revoke/' + id,
                method: 'get',
            });
        },
        taskBackByInsId(id: string) {
            return request({
                url: '/biz/flow/leave/taskBackByInsId/' + id,
                method: 'get',
            });
        },
        termination(data: object) {
            return request({
                url: '/biz/flow/leave/termination',
                method: 'post',
                data,
            });
        },
    };
}
